package generics;

import java.util.ArrayList;
import java.util.List;

public class SuperTypeWildcards {
    static void writeTo(List<? super Apple> apples) {
        apples.add(new Apple());
        apples.add(new Jonathan());
        System.out.println("是否有错？？？");
        // apples.add(new Fruit()); // Error
    }
    
    public static void main(String args[]){
        List<? super Apple> apples = new ArrayList<Fruit>();
        writeTo(apples);
        apples.add(new Apple());
        List<? extends Fruit> fruits = new ArrayList<Apple>();
    }
}